<?php

class DiaValorTotalController extends Zend_Controller_Action
{

    public function init()
    {
	    // Set No Render and Disable Layout
		$this->_helper->viewRenderer->setNoRender(true);
		$this->_helper->layout()->disableLayout();
    }

    public function indexAction()
    {
        // action body
    }
	
    public function saveAction()
    {
    	$mdlDiaValorTotal = new Application_Model_DiaValorTotal();
    	$id_dia = $this->getRequest()->getPost('id_dia', null);
    	$valor = $this->getRequest()->getPost('valor', null);
    	
    	$mdlDiaValorTotal->update(array('valor' => $valor),$mdlDiaValorTotal->getAdapter()->quoteInto('id_dia = ?',$id_dia));
    	$saida = 'R$: '.number_format($valor,2);
    	echo Zend_Json_Encoder::encode($valor);
    }

}

